/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-04-21
 * Time: 19:09
 */
class Animal implements Cloneable {
    private String name;
    private int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
public class TestDemo {
    public static void main(String[] args) throws CloneNotSupportedException {
        Animal animal = new Animal("温习文",19);
        Animal animal1 = (Animal)animal.clone();


        try {
            String str = "温习文";
            int a = 10/0;
            System.out.println(a);
           //System.out.println(str.length());
        }catch(NullPointerException e) {
           e.printStackTrace();
            System.out.println("空指针异常");
        }catch (ArithmeticException i) {
            i.printStackTrace();
            System.out.println("算数异常");
        }catch(Exception j) {
            j.printStackTrace();
        }

        System.out.println("正常程序！！");
    }
}